$alabaster: #fafafa;
$charade: #2a2734;
$dolphin: #6b677a;
$firefly: #0a1a29;
$nile: #16324e;
$pearl: #fcf8e3;
$silver: #cccccc;
$solid-white: #ffffff;
$tropaz: #254699;

$monaco: "monaco",
  "Courier New",
  Courier,
  "Lucida Sans Typewriter",
  "Lucida Typewriter",
  monospace;
$open: "Open Sans",
  sans-serif;

$desktop: 1025px;
$phone: 640px;
$tablet: 768px;

$shadow: 0px 10px 20px rgba(0, 0, 0, 0.06);

@mixin playfair($size) {
  font-family: "Playfair Display", serif;
  font-size: $size;
  font-weight: 700;
}

@font-face {
  font-display: block;
  font-family: "icomoon";
  font-style: normal;
  font-weight: normal;
  src: url("/theme-v2/fonts/icomoon.eot?n9ntun");
  src: url("/theme-v2/fonts/icomoon.eot?n9ntun#iefix") format("embedded-opentype"),
    url("/theme-v2/fonts/icomoon.ttf?n9ntun") format("truetype"),
    url("/theme-v2/fonts/icomoon.woff?n9ntun") format("woff"),
    url("/theme-v2/fonts/icomoon.svg?n9ntun#icomoon") format("svg");
}

@font-face {
  font-family: "monaco";
  src: url("/theme-v2/fonts/monaco.ttf");
}

[class^="icon-"],
[class*=" icon-"] {
  font-family: "icomoon" !important;
  font-style: normal;
  font-variant: normal;
  font-weight: normal;
  line-height: 1;
  text-transform: none;

  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

.icon-close:before {
  content: "\e904";
  color: $pearl;
}

.icon-whatsapp:before {
  content: "\e901";
}

.icon-github:before {
  content: "\e902";
}

.icon-menu:before {
  content: "\e905";
  color: $tropaz;
}

.icon-patreon:before {
  content: "\e900";
}

.icon-twitter:before {
  content: "\e903";
}

body {
  background-color: $alabaster;
  font-family: $open;

  &.menuOpen {
    height: 100%;
    overflow: hidden;

    nav {
      height: calc(100% + 10px);
      overflow-x: hidden;
      overflow-y: scroll;
    }
  }
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1 {
  @include playfair(48px);
  color: $nile;

  @media (min-width: $phone) {
    font-size: 62px;
    max-width: 600px;
  }
}

h2 {
  @include playfair(42px);
  color: $nile;
  line-height: 56px;
  margin: 0 0 16px;
}

h3 {
  color: $nile;
  font-size: 21px;
  font-weight: 400;
  line-height: 160%;
}

h4 {
  @include playfair(18px);
  background-color: $pearl;
  color: $nile;
  display: inline-block;
  margin: 16px 0 0;
  padding: 2px 10px;
}

h5 {
  color: $alabaster;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.2em;
  margin-bottom: 60px;
  text-transform: uppercase;
}

p {
  color: $nile;
  font-size: 16px;
  line-height: 180%;
  margin-bottom: 30px;
}

a {
  @include playfair(18px);
  color: $tropaz;
  font-weight: bold;
  text-decoration: none;
  transition: 0.4s;
}

button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  outline: none;
}

a[class^="btn-"] {
  border-radius: 40px;
  color: $alabaster;
  display: inline-block;
  font-family: $open;
}

.btn-primary {
  background-color: $tropaz;
  font-size: 18px;
  letter-spacing: 0.1em;
  padding: 20px 40px;
  text-transform: uppercase;
}

.btn-small {
  border: 1px solid $alabaster;
  font-size: 16px;
  padding: 2px 12px 6px;
}

.container {
  margin: 0 auto;
  max-width: 1040px;
  padding: 0 20px;
  width: calc(100% - 40px);
}

.row {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;

  @media (min-width: $desktop) {
    flex-direction: row;
  }
}

.col {
  margin: 0 auto;
  padding: 10px;
}

header {
  align-items: center;
  background-color: $solid-white;
  border-bottom: 0;
  border: solid 20px $pearl;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - 180px);
  padding: 60px 0 0;
  position: relative;
  z-index: 1;

  h3 {
    max-width: 600px;
  }

  img {
    margin: 30px;
    max-width: 300px;
    width: calc(100% - 60px);
  }

  @media (min-width: $tablet) {
    border: solid 40px $pearl;
    padding: 40px 0 30px;
  }

  @media (min-width: $desktop) {
    border: solid 60px $pearl;
    padding: 60px 30px;

    img {
      margin: 0 30px;
      max-width: 435px;
    }
  }
}

nav {
  background-color: $solid-white;
  border-radius: 0px 0px 6px 6px;
  box-shadow: $shadow;
  position: fixed;
  top: 0px;
  width: 100%;
  z-index: 999;

  .container {
    align-items: center;
    display: flex;
    height: 60px;
    justify-content: space-between;

    @media (max-width: $desktop - 1) {
      button {
        margin-top: 0;
        padding: 10px 0 10px 10px;
      }

      ul {
        background-color: $firefly;
        left: 0;
        opacity: 0;
        padding-bottom: 100%;
        padding-right: 20px;
        pointer-events: none;
        position: absolute;
        text-align: right;
        top: 0;
        transform: rotateY(180deg);
        transition: 1s;
        visibility: hidden;
        width: 100%;

        li {
          margin: 15px 30px 30px;
          opacity: 0;

          &:first-of-type {
            font-size: 24px;
          }

          a {
            color: $pearl;
            font-size: 50px;

            &.text {
              background-color: $pearl;
              color: $nile;
              font-size: 32px;
            }

            img {
              width: 44px;
            }
          }
        }

        &.on {
          opacity: 1;
          pointer-events: auto;
          transform: rotateY(0);
          visibility: visible;

          li {
            opacity: 1;
          }
        }
      }
    }

    @media (min-width: $desktop) {
      button {
        display: none;
      }

      ul {
        li {
          display: inline-block;

          &:first-of-type {
            display: none;
          }

          a {
            color: $nile;
            padding: 2px 10px;
            vertical-align: middle;

            &[class^="icon-"] {
              font-size: 24px;
            }

            &.text {
              margin-bottom: 20px;
            }

            img {
              width: 24px;
            }
          }
        }
      }
    }
  }
}

#hero {
  justify-content: center;
  padding-bottom: 60px;

  .bg {
    background-image: url("/theme-v2/images/bg-header.svg");
    background-size: 8px;
    display: none;
    height: 80px;
    position: absolute;
    width: 80px;

    @media (min-width: $phone) {
      display: block;
      height: 120px;
      width: 120px;
    }

    @media (min-width: $desktop) {
      height: 160px;
      width: 160px;
    }
  }

  .col:first-of-type {
    position: relative;

    @media (min-width: $desktop) {
      width: 80%;
    }

    .bg {
      left: -42px;
      top: -10px;
      z-index: -1;
    }
  }
}

#counter {
  background: linear-gradient(126deg, #fcf8e3 6%, #fce9d2 95%);
  border-radius: 6px;
  box-shadow: $shadow;
  color: $nile;
  font-size: 48px;
  font-weight: 700;
  margin: 0;
  min-width: 200px;
  padding: 40px 20px;
  position: relative;

  small {
    display: block;
    font-size: 28px;
    font-weight: 400;
    text-align: right;
  }

  .bg {
    right: -100px;
    top: -120px;
    z-index: -1;
  }

  .bg+.bg {
    bottom: -80px;
    left: -40px;
    right: auto;
    top: auto;
    z-index: -1;
  }

  &::after,
  &::before {
    content: "";
    background: linear-gradient(126deg, #fcf8e3 6%, #fce9d2 95%);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    box-shadow: $shadow;
    position: absolute;
    z-index: -1;
  }

  &::after {
    bottom: -20px;
    height: 20px;
    left: 20px;
    opacity: 0.8;
    width: calc(100% - 40px);
  }

  &::before {
    bottom: -40px;
    height: 20px;
    left: 40px;
    opacity: 0.6;
    width: calc(100% - 80px);
  }

  @media (min-width: $phone) {
    font-size: 72px;
    padding: 60px;

    small {
      font-size: 36px;
    }
  }

  @media (min-width: $phone) {
    padding: 40px;
  }
}

#social-links {
  margin: 60px 0 120px;

  li {
    display: inline-block;

    a {
      color: $nile;
      font-size: 38px;
      margin: 0 20px;
    }
  }

  @media (min-width: $phone) {
    margin: 0 0 60px;

    li a {
      margin: 0 32px;
    }
  }
}

#about {
  background: linear-gradient(180deg,
      $pearl 0%,
      $pearl 50%,
      $alabaster 50%,
      $alabaster 100%);

  h2,
  p {
    color: $alabaster;
  }

  &>.container {
    background-color: $firefly;
    margin-top: -60px;
    padding-bottom: 180px;
    position: relative;
    z-index: 2;

    @media (min-width: $desktop) {

      &::before,
      &::after {
        background-color: $firefly;
        content: "";
        height: 62px;
        position: absolute;
        top: -60px;
        width: 50%;
      }

      &::before {
        border-top-right-radius: 40px;
        left: 0;
      }

      &::after {
        border-top-left-radius: 40px;
        right: 0;
      }
    }
  }

  .col {
    max-width: 600px;
    padding: 40px 0 0;

    @media (min-width: $desktop) {
      max-width: 360px;
      padding: 0 80px;
    }

    &:first-of-type {
      p:first-of-type:first-letter {
        @include playfair(40px);
      }
    }
  }
}

.banner {
  background-color: $solid-white;
  border-radius: 6px;
  box-shadow: $shadow;
  margin: 0 auto;
  padding: 20px 10px;
  position: relative;
  transform: translateY(-50%);
  width: calc(100% - 180px);
  z-index: 2;

  p {
    max-width: 400px;
  }

  @media (max-width: $desktop - 1) {
    margin-bottom: -100px;
    max-width: 600px;
    width: calc(100% - 40px);

    .btn-primary {
      margin-bottom: 20px;
      padding: 20px 30px;
    }
  }

  @media (max-width: $phone - 1) {
    width: calc(100% - 20px);
  }
}

#howToUse {
  background: linear-gradient(180deg,
      $alabaster 0%,
      $alabaster 65%,
      $pearl 65%,
      $pearl 100%);
  padding-bottom: 20px;

  h2,
  p {
    text-align: center;
  }

  form {
    border-radius: 6px;
    border: 1px solid $silver;
    color: $nile;
    margin: 20px auto 40px;

    label {
      background-color: transparentize($silver, 0.8);
      border-right: 1px solid $silver;
      display: inline-block;
      font-family: $monaco;
      padding: 16px 20px;
      width: 230px;
    }

    input {
      border: none;
      color: $nile;
      font-family: $monaco;
      outline: none;
      padding: 16px 12px;
      width: calc(100% - 409px);
    }

    button {
      background-color: $tropaz;
      border-bottom-right-radius: 6px;
      border-top-right-radius: 6px;
      color: $alabaster;
      font-size: 16px;
      font-weight: 700;
      padding: 16px 30px;
      transition: 0.4s;
      width: 114px;
    }

    @media (max-width: $phone - 1) {

      label,
      input {
        width: calc(100% - 40px);
      }

      button {
        border-bottom-left-radius: 6px;
        border-top-right-radius: 0;
        width: 100%;
      }

      label {
        border-top-right-radius: 6px;
      }
    }
  }
}

pre {
  background-color: $charade;
  border-radius: 6px;
  box-shadow: $shadow;
  color: $silver;
  font-family: $monaco;
  line-height: 160%;
  max-height: 400px;
  overflow-y: scroll;
  padding: 40px;
  text-align: left;
  white-space: pre;
  word-break: break-all;
  word-wrap: break-word;

  a {
    color: $silver;
    font-family: $monaco;
    font-size: 16px;
    opacity: .5;
  }

  &::-webkit-scrollbar {
    height: 10px;
    width: 10px;
  }

  &::-webkit-scrollbar-track,
  &::-webkit-scrollbar-corner {
    background: $charade;
  }

  &::-webkit-scrollbar-thumb {
    background: $dolphin;
    border-radius: 6px;
  }
}

/* Syntax highlighting for JSON objects */
ul.json-dict,
ol.json-array {
  border-left: 1px dotted $silver;
  list-style-type: none;
  margin: 0 0 0 1px;
  padding-left: 2em;
}

.json-literal {
  font-weight: bold;
}

/* Toggle button */
a.json-toggle {
  color: inherit;
  display: inline-block;
  min-height: 13px;
  padding-left: 10px;
  position: relative;
  text-decoration: none;
}

a.json-toggle:focus {
  outline: none;
}

a.json-toggle:before {
  color: $silver;
  content: "\25BC";
  display: inline-block;
  left: -3px;
  position: absolute;
  width: 10px;
}

a.json-toggle.collapsed:before {
  transform: rotate(-90deg);
}

a.json-placeholder {
  opacity: 1;
  padding: 0 1em;
  text-decoration: none;
}



footer {
  background-color: $firefly;
  padding: 30px 0;
  position: relative;

  p {
    color: $alabaster;
  }

  .row {
    justify-content: space-between;
  }

  .col,
  p {
    margin: 0;
  }

  &::after {
    background-image: url("data:image/svg+xml,%0A%3Csvg width='18' height='4' viewBox='0 0 18 4' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 0L0 4H18L9 0Z' fill='%230A1A29'/%3E%3C/svg%3E%0A");
    content: "";
    height: 4px;
    position: absolute;
    top: -4px;
    width: 100%;
  }
}

#donate {
  background-color: $pearl;
  padding: 40px 0;
  text-align: center;

  p {
    margin-left: auto;
    margin-right: auto;
    max-width: 550px;
  }

  @media (min-width: $tablet) {
    padding: 80px 0;
  }
}

@media (hover: hover) {
  a:hover {
    color: $nile;
  }

  .btn-primary:hover,
  #howToUse form button:hover {
    background-color: $nile;
    color: $solid-white;
  }

  .btn-small:hover {
    background-color: $alabaster;
    color: $firefly;
  }

  #social-links li a:hover {
    color: $tropaz;
  }

  pre a:hover {
    color: $silver;
    text-decoration: underline;
  }

  @media (min-width: $desktop) {
    nav ul li a.text:hover {
      background-color: $pearl;
    }

    nav ul li a[class^="icon-"]:hover {
      color: $tropaz;
    }
  }
}